1. Field of the Invention
The present invention relates to a peripheral device that communicates over a peripheral bus, such as a flash memory device.
2. Description of the Related Art
A universal serial bus (USB) is a serial bus standard to interface devices. USB was designed to allow peripherals to be connected using a single standardized interface socket and to improve plug-and-play capabilities by allowing devices to be connected and disconnected without rebooting the computer. Other convenient features include providing power to low-consumption devices without the need for an external power supply and allowing many devices to be used without requiring manufacturer specific, individual device drivers to be installed. USB is intended to help retire all legacy varieties of serial and parallel ports. USB can connect computer peripherals such as mouse devices, keyboards, PDAs, gamepads and joysticks, scanners, digital cameras, printers, personal media players, and flash drives. For many of those devices USB has become the standard connection method.
A USB system has an asymmetric design, consisting of a host, a multitude of downstream USB ports, and multiple peripheral devices connected in a tiered-star topology. USB devices are linked in series through hubs. There always exists one hub known as the root hub, which is built-in to the host controller. Additional USB hubs may be included in the tiers, allowing branching into a tree structure. A USB host may have multiple host controllers and each host controller may provide one or more USB ports.
A single physical USB device may consist of several logical sub-devices that are referred to as device functions, because each individual device may provide several functions, such as a webcam (video device function) with a built-in microphone (audio device function). USB endpoints actually reside on the connected device and the logical channels for communication with the host are referred to as pipes. Pipes are connections from the host controller to a logical entity on the device named an endpoint. Each endpoint can transfer data in one direction only, either into or out of the device, so each pipe is uni-directional. Endpoints are grouped into interfaces and each interface is associated with a single device function. An exception to this is endpoint zero, which is used for device configuration and which is not associated with any interface.
When a new USB device is connected to a USB host, the USB device enumeration process is started. The enumeration process first sends a reset signal to the USB device. The speed of the USB device is determined during the reset signaling. After reset, USB device setup information is read from the device by the host and the device is assigned a unique host-controller specific 7-bit address. If the device is supported by the host, the device drivers needed for communicating with the device are loaded and the device is set to a configured state. If the USB host is restarted, the enumeration process is repeated for all connected devices.
The host controller polls the bus for traffic, usually in a round-robin fashion, so that no USB device can transfer any data on the bus without an explicit request from the host controller. Devices that attach to the bus can be specialized devices requiring a device-specific device driver to be used, or may belong to a device class. These device classes define an expected behavior in terms of device and interface descriptors so that the same device driver may be used for any device that claims to be a member of a certain class. An operating system is supposed to implement all device classes so as to provide generic drivers for many USB devices.
USB standards generally support three data rates. A Low Speed rate of 1.5 Mbit/s (187 kB/s) is mostly used for Human Interface Devices (HID) such as keyboards, mice, and joysticks (available under USB Specifications 1.1 and 2.0). A Full Speed rate of 12 Mbit/s (1.5 MB/s) (available under USB Specifications 1.1 and 2.0) divides its USB bandwidth between USB devices in a first-come first-served basis. A Hi-Speed rate of 480 Mbit/s (60 MB/s) is currently the fastest speed in use (available only under USB Specification 2.0).